//
//  NoteViewController.m
//  Pad-test
//
//  Created by jjkj on 17/3/3.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "NoteViewController.h"
#import "SchedulingRecordView.h"
#import "SchedulingRecordsModel.h"
#import "RecordsView.h"
@interface NoteViewController (){
    
}

@property (nonatomic, strong) UIScrollView *schedulingRecordsScrollV;

@property (nonatomic, strong) SchedulingRecordsModel *recordModel;
@end

@implementation NoteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initRecordModel];
    
    self.view.frame = CGRectMake(176, 100,kScreen_Width-176,kScreen_Height-100);
    self.view.backgroundColor = [UIColor whiteColor];
    
//    self.schedulingRecordsScrollV = [[UIScrollView alloc]initWithFrame:CGRectMake(8, 50, kScreen_Width-184, kScreen_Height-150)];
//    for (int i=0; i<10; i++) {
//        UIScrollView *scrollV = [[UIScrollView alloc]init];
//        SchedulingRecordView *recordsV = [[SchedulingRecordView alloc]initWithFrame:CGRectMake(0, 0, 580, 850)];
//        [recordsV setModel:self.recordModel];
//        recordsV.heightBlock = ^(CGFloat aHeight){
//            NSLog(@"aHeight==%f",aHeight);
//        };
//        [scrollV addSubview:recordsV];
//        [scrollV setFrame:CGRectMake(580*i, 0, 580, 850)];
//        scrollV.contentSize = CGSizeMake(580, 850);
//        [self.schedulingRecordsScrollV addSubview:recordsV];
//    }
//    self.schedulingRecordsScrollV.contentSize = CGSizeMake(580*9, 850);
//    [self.view addSubview:self.schedulingRecordsScrollV];
    
    self.schedulingRecordsScrollV = [[UIScrollView alloc]initWithFrame:CGRectMake(8, 50, kScreen_Width-184, kScreen_Height-150)];
    for (int i=0; i<10; i++) {
        RecordsView *recordsView = [[NSBundle mainBundle]loadNibNamed:@"RecordsView" owner:self options:nil].firstObject;
        [recordsView setFrame:CGRectMake(0, 0, 580, 850)];
        [recordsView setModel:self.recordModel];
        
        [recordsView setFrame:CGRectMake(580*i, 0, 580, 850)];
        
        [self.schedulingRecordsScrollV addSubview:recordsView];
    }
    self.schedulingRecordsScrollV.contentSize = CGSizeMake(580*9, 850);
    [self.view addSubview:self.schedulingRecordsScrollV];
    
}
- (void)initRecordModel{
    
    self.recordModel = [[SchedulingRecordsModel alloc]initWithDictionary:
  @{
    @"recordOfDate" : @"2017-02-24",
    @"dirctorName" : @"高斌",
    @"monitorName" : @"张开心  赵欢乐",
    @"dispatcherName" : @"郝调度",
    @"ledIndicator" : @"年前作业，不能疏忽大意，注意生产安全。确保平安回家过年。",
    @"schedulingRecords" : @"推土机：9#10#12#爬车牵引 \n外线：何所12#盘306m延3控（8#牙轮）\n推土机：9#10#12#爬车牵引 \n外线：何所12#盘306m延3控（8#牙轮）\n推土机：9#10#12#爬车牵引 \n外线：何所12#盘306m延3控（8#牙轮）",
    @"firePrevention" : @"防火工具绝缘保护",
    @"workingCondition" : @"作业条件环境因素",
    @"safetyProtection" : @"防火工具绝缘保护",
    @"outageRecords" : @"推土机：9#10#12#爬车牵引\
    外线：何所12#盘306m延3控（8#牙轮）\n推土机：9#10#12#爬车牵引",
    @"other" : @"推土机：9#10#12#爬车牵引\
    外线：何所12#盘306m延3控（8#牙轮）\n推土机：9#10#12#爬车牵引"
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
